From: Florian Müllner Date: Mon, 23 Mar 2020 17:00:27 +0000 (+0100) Subject: environment: Hook up touch_file to GFile prototype X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~751^2^2~63 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=78997cb7ebea1089035a45f3621655193f211963;p=gnome-shell.git environment: Hook up touch_file to GFile prototype We don't usually extend introspected types with our own API, but in this case it's too tempting to make the helper functions usable with Gio._promisify() ... https://gitlab.gnome.org/GNOME/gnome-shell/issues/2432 --- diff --git a/js/ui/environment.js b/js/ui/environment.js index 0450f7932..6764bd279 100644 --- a/js/ui/environment.js +++ b/js/ui/environment.js @@ -10,7 +10,7 @@ imports.gi.versions.Gtk = '3.0'; imports.gi.versions.TelepathyGLib = '0.12'; imports.gi.versions.TelepathyLogger = '0.2'; -const { Clutter, GLib, GObject, Meta, Shell, St } = imports.gi; +const { Clutter, Gio, GLib, GObject, Meta, Shell, St } = imports.gi; const Gettext = imports.gettext; const System = imports.system; @@ -288,6 +288,13 @@ function init() { }, }); + Gio._LocalFilePrototype.touch_async = function (callback) { + Shell.util_touch_file_async(this, callback); + }; + Gio._LocalFilePrototype.touch_finish = function (result) { + return Shell.util_touch_file_finish(this, result); + }; + St.set_slow_down_factor = function (factor) { let { stack } = new Error(); log(`St.set_slow_down_factor() is deprecated, use St.Settings.slow_down_factor\n${stack}`);